import React, {Component} from 'react'
import HKBall from "../../BallStyle/HKBall"

export default class ShengXiao extends Component {
  constructor (props){
   super(props)
   this.state= {
   }
}
order(item){
  this.props.order(item)
}
weiShuNum(){
  return [
    [10, 20, 30, 40],
    [1, 11, 21, 31, 41],
    [2, 12, 22, 32, 42],
    [3, 13, 23, 33, 43],
    [4, 14, 24, 34, 44],
    [5, 15, 25, 35, 45],
    [6, 16, 26, 36, 46],
    [7, 17, 27, 37, 47],
    [8, 18, 28, 38, 48],
    [9, 19, 29, 39, 49]]
}
getNum(item){
  // let ws = item.id.match(/\d+/)[0];
  let ws = item.number;
  const weihu = this.weiShuNum()
  let nums = weihu[ws];
  // console.log(nums);
  return  nums
}
   render() {
    const {content,select} = this.props
    
   return <div className="peilv">
             <div className="wenzi">
              {
                content.map((item,index)=>{
                  return <li key={index} onClick={()=>{
                        this.order(item)
                  }}
                  className={select[item.id] ? "selected big" : "big"}
                  >
                {/* {isNaN(item.number*1) ? <span className={"noball "+item.id}>{item.number}</span> :
                  <HKBall num={item.number*1}></HKBall>} */}
                  <h5 className={"noball "+item.id}>{item.number+"尾"}</h5>
                  <div className="qiu">
                  {this.getNum(item).map((num,i)=>{
                    return <HKBall num={num*1} key={i}></HKBall>
                  })}
                  </div>
                  <p className="red">{item.pl}</p></li>
                })
              }
              </div>
        </div>
   }
}